-- 蓝色武器数据

local function torch_onequip(inst, owner) 
    owner.AnimState:OverrideSymbol("swap_object", "swap_torch", "swap_torch")
    owner.AnimState:Show("ARM_carry") 
    owner.AnimState:Hide("ARM_normal") 
    
    inst.SoundEmitter:PlaySound("dontstarve/wilson/torch_LP", "torch")
    inst.SoundEmitter:PlaySound("dontstarve/wilson/torch_swing")
    inst.SoundEmitter:SetParameter( "torch", "intensity", 1 )

    inst.fire = SpawnPrefab( "torchfire" )
    local follower = inst.fire.entity:AddFollower()
    follower:FollowSymbol( owner.GUID, "swap_object", 0, -110, 1 )
end

local function torch_onunequip(inst,owner) 
	inst.fire:Remove()
    inst.fire = nil
    
    owner.AnimState:Hide("ARM_carry") 
    owner.AnimState:Show("ARM_normal")
    inst.SoundEmitter:KillSound("torch")
    inst.SoundEmitter:PlaySound("dontstarve/common/fireOut")        
end

local function nightstick_onequip(inst, owner) 
    owner.AnimState:OverrideSymbol("swap_object", "swap_nightstick", "swap_nightstick")
    owner.AnimState:Show("ARM_carry") 
    owner.AnimState:Hide("ARM_normal") 
    
    inst.SoundEmitter:PlaySound("dontstarve_DLC001/common/morningstar", "torch")

    inst.fire = SpawnPrefab( "nightstickfire" )
    local follower = inst.fire.entity:AddFollower()
    follower:FollowSymbol( owner.GUID, "swap_object", 0, -110, 1 )
    end

local function nightstick_onunequip(inst,owner) 
	inst.fire:Remove()
    inst.fire = nil
    
    owner.AnimState:Hide("ARM_carry") 
    owner.AnimState:Show("ARM_normal")
    inst.SoundEmitter:KillSound("torch")
end

return {
	torch = {
		init_ds = true,
		name = "火把",
		desc = "简单的照明工具。",

		damage = 10,

		recipe = { "cutgrass", "twigs" },

		element = {
			fire = 0.25,
		},

		init = {
			equippable = {
				SetOnEquip = { torch_onequip },
				SetOnUnequip = { torch_onunequip },
			}
		}
	},

	--- 狗牙棒（狗牙+树枝）
	spear_poison = {
		init_ds = true,
		name = "毒矛",
		desc = "这把矛上面可是涂满了剧毒。",

		damage = 34,

		recipe = { "spear", "greengem" },

		element = {
			poison = 0.25,
		},
	},

	staff_fire = {
		init_ds = true,
		name = "火魔杖",

		projectile = nil,

		damage = 25,

		element = {
			fire = 1.0,
		},

		recipe = { "spear", "redgem" },
	},

	staff_ice = {
		init_ds = true,
		name = "冰魔杖",

		projectile = nil,

		damage = 20,

		element = {
			ice = 1.0,
		},

		recipe = { "spear", "bluegem" },
	},

	staff_poison = {
		init_dst = true,
		name = "毒魔杖",
		desc = "",

		damage = 10,

		recipe = { "spear", "greengem" },

		element = {
			poison = 1.0,
		},
	},

	nightstick = {
		init_ds = true,
		name = "晨星",
		desc = nil,

		init = {
			equippable = {
				SetOnEquip = { nightstick_onequip },
				SetOnUnequip = { nightstick_onunequip },
			},
		},

		element = {
			electric = 0.25,
		},

		damage = 45,

		recipe = { "spear", "yellowgem" },

	},

	hambat = {
		init_ds = true,
		name = "火腿棒",

		components = { "rg_edibleweapon" },

		recipe = { "twigs", "meat", "meat" },
	},

	blowdart_fire = {
		init_ds = true,

		damage = 20,

		recipe = { "blowdart_pipe", "redgem" },

		element = {
			fire = 1.0,
		},
	},

	blowdart_poison = {
		init_ds = true,
		dlc = "SW",

		damage = 20,

		recipe = { "blowdart_pipe", "greengem" },

		element = {
			poison = 1.0,
		},
	},

	batbat = {
		init_ds = true,

		damage = 33,

		-- 吸血
	},

	spear_wathgrithr = {
		init_ds = true,
		name = "维京战矛",
		desc = "打的就是精锐。",

		tags = { "rg_epickiller" },
		init_ds = true,

		damage = 45,

		recipe = { "spear", "goldnugget" },
	},

	spear_sharp = {
		init_dst = true,
		name = "锋利长矛",

		element = {
			injury = 5,
		},
	},
}

-- 维京战矛（对boss和精英怪造成1.5倍伤害）长矛+金块
-- 锋利长矛（敌人被击中后重伤5s）长矛+燧石+燧石